
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #333;
    display: flex;
    justify-content: center;
    align-items: center;
}


.box {
    width: 300px;
    height: 450px;
    margin: 20px;
    position: relative;
}

.box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: grayscale(100%);
    background-size: cover;
    background-image: var(--i);
    transition: .5s;
}

.box:hover::before {
    width: 0;
}

.box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}